//src里面的api文件夹，专门根据页面的请求管理接口的
import store from "@/store";
import request from "@/utils/request";

//封装一个登录的接口
export const loginAPI = (data) => {
  return request({
    url: '/v1_0/authorizations',
    method: 'POST',
    data
  })
}

//封装获取用户个人资料的接口
export const userinfoAPI = () => {
  return request({
    url: 'v1_0/user/profile',
  })
}

//修改用户资料的接口
export const editUserInfo = data => {
  return request({
    url: '/v1_0/user/profile',
    method: 'patch',
    data
  })
}

//修改用户头像的接口
export const editPhotoAPI = data => {
  return request({
    url: '/v1_0/user/photo',
    method: 'patch',
    data
  })
}